<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Display Image from JSON</title>
</head>
<body>
 
<!-- 图片将显示在这里【完成】 -->
<div class="blog-post-thumb position-relative">
<img class="imgapi" src="https://t.alcy.cc/ai?time=1735454466226?time=1735454467917?time=1735454469173" onclick="refreshImage(this)">
</div>
		<img src="https://api.rls.ovh/adaptive"><br>
 <div align=center> 
	 <img src='https://imgapi.cn/cos2.php?return=url'></img><br>
	 <img src='https://imgapi.cn/cos2.php?return=urlpro'></img><br>
	 <img src='https://imgapi.cn/cos2.php?return=img'></img><br>
	 <img src='https://imgapi.cn/cos.php?return=url'></img><br>
	 <img src='https://imgapi.cn/cos.php?return=urlpro'></img><br>
	 <img src='https://imgapi.cn/api.php?zd=pc&gs=images'></img><br>
	 <img src=' https://imgapi.cn/bing.php?rand=true'></img><br>
	 <img src='https://imgapi.cn/ip.php?diy=576O5aWzQ09T'></img><br>
  </div>
 <hr>
   <img src=' https://api.btstu.cn/sjbz/api.php?lx=meizi&format=images'></img><br>
   <img src='https://www.dmoe.cc/random.php'></img><br>
   <img src='https://cdn.seovx.com/?mom=302'></img><br>
 <hr>
  <h3><font color=GoldenRod align=center><div id=Text></div></font></h3>
 <hr>
 <div id="imagelist" align=center></div>
<div style="text-align: center;"><button  id="myButton4">看视频</button></div>
<script>
    // 假设你的JSON数据
		   	fetch('https://api.lolimi.cn/API/cosplay/api.php')
				.then(response => response.json())
				.then(data => {console.log(data);
					if (data.data){
				// 获取图片URL
				const imageUrls = data.data.data;
				const textA = data.data.Title;
				//console.log(imageUrl);
				document.getElementById('Text').innerText=textA;
				const imageContainer = document.getElementById('imagelist');
			 
				// 遍历数组，为每个图片地址创建一个img元素，并添加到容器中
				imageUrls.forEach(url => {
				  const img = document.createElement('img');
				  img.src = url;
				  img.alt = 'Image from array'; // 可选：为图片添加alt属性
				  img.style.maxWidth = 'auto'; // 可选：设置图片最大宽度以适应容器
				  imageContainer.appendChild(img);
				})
						} else {
                    console.error('无法获取新的视频链接');
					}
            })
            .catch(error => console.error('获取视频时出错:', error));
</script>
<script>//img监控
function refreshImage(imgElement) {
  var src = imgElement.src;
  var newSrc = src + "?time=" + Date.now();
  imgElement.src = newSrc;
}
  
var imgElements = document.getElementsByTagName("img");
for (var i = 0; i < imgElements.length; i++) {
  imgElements[i].addEventListener("click", function() {
    refreshImage(this);
  });
}
      document.getElementById('myButton4').addEventListener('click', function() {
       window.location.href = 'index.html';
   });
/*
console.log("\n %c 你好世界！www.mwm.moe%c ","color:#fff;background:linear-gradient(90deg,#FFC0CB,#FFC0CB);padding:5px 0;","color:#000;background:linear-gradient(90deg,#FFC0CB,#ffffff);padding:5px 10px 5px 0px;");
console.log("\n %c 你好世界！t.mwm.moe%c ","color:#fff;background:linear-gradient(90deg,#FFC0CB,#FFC0CB);padding:5px 0;","color:#000;background:linear-gradient(90deg,#FFC0CB,#ffffff);padding:5px 10px 5px 0px;");
*/
</script>
  <style>
    img {
        max-width: 100%;
        height: auto;
    }
}
</style>
</body>
</html>